
#include "MissionDialogue.h"
#include "../share/user_define.h"

//-------------------------------------------------------------------------------
MissionDialogue::MissionDialogue(void)
	: m_title(nullptr)
	, m_describe(nullptr)
	, m_option_1(nullptr)
	, m_option_2(nullptr)
	, m_option_3(nullptr)
	, m_option_4(nullptr)
	, m_mission_id(0)
	, m_user_1(0)
	, m_user_2(0)
	, m_user_3(0)
{
	_safe_guard_begin;
	_safe_guard_end;
}

//-------------------------------------------------------------------------------
MissionDialogue::~MissionDialogue(void)
{
	clear();
}

//-------------------------------------------------------------------------------
void MissionDialogue::DialogueStart(void)
{
	_safe_guard_begin;

	clear();

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::DialogueFinish(void)
{
	_safe_guard_begin;
	
	Display();

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetTitle(const char* val)
{
	_safe_guard_begin;
	
	m_title = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetDescribe(const char* val)
{
	_safe_guard_begin;

	m_describe = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetOption1(const char* val)
{
	_safe_guard_begin;

	m_option_1 = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetOption2(const char* val)

{
	_safe_guard_begin;

	m_option_2 = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetOption3(const char* val)
{
	_safe_guard_begin;

	m_option_3 = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetOption4(const char* val)
{
	_safe_guard_begin;

	m_option_4 = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetMissionId(uint32_t val)
{
	_safe_guard_begin;

	m_mission_id = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetUserVal1(uint32_t val)
{
	_safe_guard_begin;
	
	m_user_1 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetUserVal2(uint32_t val)
{
	_safe_guard_begin;

	m_user_2 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::SetUserVal3(uint32_t val)
{
	_safe_guard_begin;
	
	m_user_3 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void MissionDialogue::Display(void)
{
	_safe_guard_begin;
	
	_safe_guard_end;
}

//-------------------------------------------------------------------------------
std::string * MissionDialogue::GetTitle(void)
{
	_safe_guard_begin;

	return m_title;

	_safe_guard_end;
	
	return nullptr;
}

//-------------------------------------------------------------------------------
std::string * MissionDialogue::GetDescribe(void)
{
	_safe_guard_begin;

	return m_describe;

	_safe_guard_end;

	return nullptr;
}

//-------------------------------------------------------------------------------
std::string * MissionDialogue::GetOption1(void)
{
	_safe_guard_begin;

	return m_option_1;

	_safe_guard_end;

	return nullptr;
}

//-------------------------------------------------------------------------------
std::string * MissionDialogue::GetOption2(void)
{
	_safe_guard_begin;

	return m_option_2;

	_safe_guard_end;

	return nullptr;
}

//-------------------------------------------------------------------------------
std::string * MissionDialogue::GetOption3(void)
{
	_safe_guard_begin;

	return m_option_3;

	_safe_guard_end;

	return nullptr;
}

//-------------------------------------------------------------------------------
std::string * MissionDialogue::GetOption4(void)
{
	_safe_guard_begin;
	
	return m_option_4;
	
	_safe_guard_end;
	return nullptr;
}

//-------------------------------------------------------------------------------
uint32_t MissionDialogue::GetMissionId(void)
{
	_safe_guard_begin;

	return m_mission_id;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t MissionDialogue::GetUserVal1(void)
{
	_safe_guard_begin;

	return m_user_1;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t MissionDialogue::GetUserVal2(void)
{
	_safe_guard_begin;

	return m_user_2;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t MissionDialogue::GetUserVal3(void)
{
	_safe_guard_begin;

	return m_user_3;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
void MissionDialogue::clear(void)
{
	if (m_title)
	{
		string_factory::FreeString(m_title);
		m_title = nullptr;
	}

	if (m_describe)
	{
		string_factory::FreeString(m_describe);
		m_describe = nullptr;
	}

	if (m_option_1)
	{
		string_factory::FreeString(m_option_1);
		m_option_1 = nullptr;
	}

	if (m_option_2)
	{
		string_factory::FreeString(m_option_2);
		m_option_2 = nullptr;
	}

	if (m_option_3)
	{
		string_factory::FreeString(m_option_3);
		m_option_3 = nullptr;
	}

	if (m_option_4)
	{
		string_factory::FreeString(m_option_4);
		m_option_4 = nullptr;
	}

	m_mission_id = 0;
	m_user_1 = 0;
	m_user_2 = 0;
	m_user_3 = 0;


}
